<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\bootstrap\ActiveForm;
use yii\web\View;
/* @var $this yii\web\View */
/* @var $model common\models\User */
$this->registerJsFile('/js/jquery.SuperSlide.2.1.1.js');
$this->registerJsFile('/js/common_js.js',['position'=>View::POS_BEGIN]);
$this->registerCssFile('/css/common.css');
$this->registerCssFile('/fonts/iconfont.css');
$this->registerCssFile('/css/Orders.css');
$this->registerJsFile('/js/public.js');
$this->registerJsFile('/layer/layer.js');
$this->registerJs('jQuery(".recommend_list").slide({
						titCell : ".hd ul",
						mainCell : ".bd ul",
						autoPage : true,
						effect : "left",
						autoPlay : true,
						vis : 5
					});');
$this->title = '购物车-锐锋堂刀剑网';
?>
<!--购物车样式-->
	<div class="Inside_pages clearfix">
		<div class="shop_carts">
			<div class="Process">
				<img src="/images/Process_img_01.png" />
			</div>
			<div class="Shopping_list">
				<div class="shopping">
				<?php $form=ActiveForm::begin([
				    'id'=>'cartform',
				    'action'=>'/goods/order.html'
				]);?>
						<table class="table_list">
						<tr class='th'>
							<th>选择</th>
							<th>商品图</th>
							<th>名称</th>
							<th>市场价</th>
							<th>本店价</th>
							<th>购买数量</th>
							<th>小计</th>
							<th>操作</th>
						</tr>
						<?php if(!empty($cart)):?>
						<?php foreach($cart as $val):?>
							<tr class="tr">
								<td class="checkbox"><input name="ids[]"
									type="checkbox" onclick='runTotal(this)' value="<?=$val['id']?>" /></td>
								<td><a href="/goods/view-<?=$val['goods']['id']?>"><img src="<?=$val['goods']['logo']?>" /></a></td>
								<td class="name">
										<?=$val['goods']['name']?>
								</td>
								<td class="scj sp">￥<span class="price_one"><?=$val['goods']['price']?></span></td>
								<td class="bgj sp">￥<span id="price_item_1"><?=$val['goods']['price']?></span></td>
								<td class="sl">
									<div class="Numbers">
										<a onclick="cartPrice(this)" href="javascript:void(0)" class="jian">-</a> <input
											type="text" value="<?=$val['num']?>" id="qty_item_1"
											onkeyup="keyTotal(this)" class="number_text">
											<a onclick="cartPrice(this,1)"
											href="javascript:void(0)" class="jia">+</a>
									</div>
								</td>
								<td class="xj">￥<span class='price_sum'><?=sprintf('%.2f',$val['num']*$val['goods']['price'])?></span></td>
								<td class="cz">
									<p onclick='delAlter(this,<?=$val['id']?>)'>
										<a href="javascript:;">删除</a>
										<P>
								</td>
							</tr>
							<?php endforeach;?>
							<?php endif;?>
						</table>
						<div class="sp_Operation clearfix">
							<div class="select-all">
								<div class="cart-checkbox">
									<input type="checkbox" id='cartall' onclick='totalAll(this)'
										class="jdcheckbox" clstag="clickcart">全选
								</div>
								<div class="operation" onclick='delAlterAll()'>
									<a href="javascript:void(0);" id="send">删除选中的商品</a>
								</div>
							</div>
							<!--结算-->
							<div class="toolbar_right">
								<ul class="Price_Info">
									<li class="p_Total"><label class="text">商品总价：</label><span
										class="price sumPrice" id="Total_price">0.00</span>元</li>
									
								</ul>
								<div class="btn">
									<a class="cartsubmit" onclick='$("#cartform").submit()'></a><a
										class="continueFind" href="/goods/index.html" ></a>
								</div>
							</div>
						</div>
					 <?php ActiveForm::end(); ?>
				</div>
			</div>
			<!--推荐产品样式-->
			<div class="recommend_shop">
				<div class="title_name">推荐购买</div>
				<div class="recommend_list">
					<div class="hd">
						<a class="prev" href="javascript:void(0)">&gt;</a> <a class="next"
							href="javascript:void(0)">&lt;</a>
					</div>
					<div class="bd">
						<ul>
						<?php if(!empty($hot)):?>
						<?php foreach($hot as $val):?>
							<li class="recommend_info"><a href="/goods/view-<?=$val['id']?>.html" class="buy_btn">立即购买</a>
								<a href="/goods/view-<?=$val['id']?>.html" class="img"><img src="<?=$val['logo']?>"
									width="215px" height="150px" /></a> <a href="/goods/view-<?=$val['id']?>.html" class="name"><?=$val['name']?></a>
								<h4>
									<span class="Price">123.00<i>人民币</i></span>
								</h4></li>
						<?php endforeach;?>
						<?php endif;?>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>